<?php
@include('include/common.inc.php');
$query ="select * from $TBL_HOUSE where  saveplan=3 and del=0 order by id desc";
$cur_page = (int)$_GET["p"];   //获取当前页
$url_param = preg_replace("/(p=[0-9]+)&/", "", $_SERVER['QUERY_STRING']);
$pages = new Pager($query, $cur_page, 18, $url_param);
$page_string = $pages -> getPageString();   
$result = $pages -> getRsPerPage();
$count = @mysql_num_rows($result);
while($rows = $db->fetch_array($result))
{
	if($rows['hou_type']==1)
	{
		$rows['titlex'] ='租金';
	}elseif($rows['hou_type']==2){
		$rows['titlex'] ='賣價';
	}else{
		$rows['titlex'] ='賣價';
	}
	$rows['ADDR']=FSubstr(str_replace("&nbsp;","",strip_tags($rows[address])),0,26);
	$rows['TIT']=FSubstr(str_replace("&nbsp;","",strip_tags($rows[title])),0,26);
	$row1[]=$rows;
}		
if($count ==0)
{
	$note = "對不起,沒有您要搜尋的房屋！";
}
$smarty->assign("row1",$row1);
@include('number.php');//验证码
$smarty->assign("page_string",$page_string);
$smarty->display('search.html');
?>